var uid = 0
export default class Dep{
  constructor() {
    console.log("w d DEP")
    //放置的是Watcher实例
    this.uid += 1
    this.subs =[]
  }
  add(sub){
    this.subs.push(sub)
  }
  depend(){
    if (Dep.target){
      this.add(Dep.target)
    }
  }
  notify(){
    console.log("notify")
    const subs = this.subs.slice();

    for( let i =0,l=subs.length;i<l;i++){
      subs[i].update()
    }
  }
}